package com.ljtxxhwj.myblob.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.sql.Date;


@Data
@NoArgsConstructor
public class Comment {
    Integer commentId;
    Integer articleId;//这里不外连接
    Article article;//后面发现要外连接
    private Integer userId;             // 发表评论的用户ID
    User user;//这里需要外连接，因为我要用户名
    String commentContent;
    Integer replyId;
    @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss", timezone = "GMT+8")
    Date commentDate;

    // 可以根据需要添加getter和setter方法，或者使用lombok的@Data注解自动生成
    public Comment(Integer articleId, Integer userId, String commentContent, Integer replyId, Date commentDate) {
        this.articleId = articleId;
        this.userId = userId;
        this.commentContent = commentContent;
        this.replyId = replyId;
        this.commentDate = commentDate;
    }
}
